Action hook 'add_meta_boxes_{$post_type}'

in WP Core File wp-admin/includes/meta-boxes.php at line 1733

View Source

add_meta_boxes_{$post_type}

Action Hook
Description
Fires after all built-in meta boxes have been added, contextually for the given post type. The dynamic portion of the hook name, `$post_type`, refers to the post type of the post. Possible hook names include: - `add_meta_boxes_post` - `add_meta_boxes_page` - `add_meta_boxes_attachment`

Hook Information

File Location wp-admin/includes/meta-boxes.php View on GitHub
Hook Type Action
Line Number 1733

Hook Parameters

Type Name Description
WP_Post $post Post object.

Usage Examples

Basic Usage
<?php
// Hook into add_meta_boxes_{$post_type}
add_action('add_meta_boxes_{$post_type}', 'my_custom_function', 10, 1);

function my_custom_function($post) {
    // Your custom code here
}

Source Code Context

wp-admin/includes/meta-boxes.php:1733 - How this hook is used in WordPress core
<?php
1728  	 *
1729  	 * @since 3.0.0
1730  	 *
1731  	 * @param WP_Post $post Post object.
1732  	 */
1733  	do_action( "add_meta_boxes_{$post_type}", $post );
1734  
1735  	/**
1736  	 * Fires after meta boxes have been added.
1737  	 *
1738  	 * Fires once for each of the default meta box contexts: normal, advanced, and side.

PHP Documentation

<?php
/**
	 * Fires after all built-in meta boxes have been added, contextually for the given post type.
	 *
	 * The dynamic portion of the hook name, `$post_type`, refers to the post type of the post.
	 *
	 * Possible hook names include:
	 *
	 *  - `add_meta_boxes_post`
	 *  - `add_meta_boxes_page`
	 *  - `add_meta_boxes_attachment`
	 *
	 * @since 3.0.0
	 *
	 * @param WP_Post $post Post object.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-admin/includes/meta-boxes.php
Related Hooks

Related hooks will be displayed here in future updates.